package com.bigluo.util.redis;

import com.bigluo.common.enums.ERedisCachePrefix;

import java.util.concurrent.TimeUnit;

/**
 * Created by luojun on 2017/9/5.
 */
public interface IRedisCacheService {
    /**
     * 向redis缓存中存入值
     * @param prefix
     * @param key
     * @param value
     * @param <T>
     */
    <T> void  setVal(ERedisCachePrefix prefix,String key,T value);

    <T> void  setVal(ERedisCachePrefix prefix, String key, T value, Long timeOut, TimeUnit timeUnit);

    /**
     * 获取redis中缓存的值
     * @param preifx
     * @param key
     * @param <T>
     * @return
     */
    <T> T getVal(ERedisCachePrefix preifx,String key,Class<T> classType);

    void delVal(ERedisCachePrefix prefix,String key);
}
